<template>
	<view>
		<view class="textarea">
		<textarea class="feedBack" v-model="curData.content" placeholder="请您填写反馈意见,不多于500字."></textarea>			
		</view>
		<view class="btn">
			<button @click="tj" style="background-color:#F5BF46 ;color: white;">提交</button>
		</view>
		
    </view>
</template>

<script>
	export default {
		data() {
			return {
				curData:{
					content:null,
					parentVxid:null
				}
			}
		},
		methods: {
			
			
	
			tj(){
				
				let userInfo = uni.getStorageSync("userInfo") //拿之前家长微信登录时存进去的 userinfo
				this.curData.parentVxid = userInfo.mpWeixinOpenId //根据 userinfo 拿到 微信id
				let that=this;
				uni.showModal({
					content:"提交成功",
					success:function(res){
						if(res.confirm){
							uni.$api.appFeedBackAdd(that.curData);
							uni.switchTab({
								url:'/pages/me/me'
							})
						}
						
					}
				})
				
				
				this.$api.appFeedBackAdd(this.curData);
				uni.showModal({
					content:"确认提交",
					success:function(res){
						if(res.confirm){
							
							uni.switchTab({
							    url: '/pages/me/me'
							})
						}
						else if(res.cancel){
							
						}
					}
				})
			}
			
		}
	}
</script>

<style lang="scss">
	.textarea{
		margin: 10px 10px 10px 40px;
		width: 98%;
		.feedBack{
			border: 1px #eee solid;
			border-radius: 10px;
		}
	}
	
	.btn{
		button{
			margin-top:200px;
			width: 300px;
		}
	}	
		

	

</style>
